home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / os2 / chgctl21.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1996-01-03  |  8KB  |  262 lines

  1. /************************************************************
  2. Change Controls Installation Program 2.1
  3. *************************************************************/
  4. '@echo off'
  5. 'ansi on'
  6. 'cls'
  7. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  8. call SysLoadFuncs
  9. call startups 'Checking files in directory'
  10. say'Checking for files...'
  11. call check 'BUTTONS.BMP'
  12. call check 'chg_ctls.cmd'
  13. call check 'chg_pm.exe'
  14. call check 'chg_pm.HLP'
  15. call check 'chg_pm.INF'
  16. call check 'ctls.RC'
  17. call check 'ctls.RES'
  18. call check 'down.bmp'
  19. call check 'down_d.bmp'
  20. call check 'down_g.bmp'
  21. call check 'HIDE_D.BMP'
  22. call check 'HIDE_U.BMP'
  23. call check 'left.bmp'
  24. call check 'left_d.bmp'
  25. call check 'left_g.bmp'
  26. call check 'list.BMP'
  27. call check 'logos.zip'
  28. call check 'maxi_d.bmp'
  29. call check 'maxi_up.bmp'
  30. call check 'max_d.BMP'
  31. call check 'max_u.bmp'
  32. call check 'min_d.bmp'
  33. call check 'min_up.BMP'
  34. call check 'motif.zip'
  35. call check 'npswpscb.bmp'
  36. call check 'npswpscb.txt'
  37. call check 'rdc.cmd'
  38. call check 'readme.cmd'
  39. call check 'REBUILD.CMD'
  40. call check 'resmgr.cmd'
  41. call check 'RESMGR.ZIP'
  42. call check 'right.bmp'
  43. call check 'right_d.bmp'
  44. call check 'right_g.bmp'
  45. call check 'source.zip'
  46. call check 'swap_dll.exe'
  47. call check 'swap_dll.txt'
  48. call check 'sys_d_l.bmp'
  49. call check 'sys_d_s.bmp'
  50. call check 'sys_u_l.bmp'
  51. call check 'sys_u_s.bmp'
  52. call check 'up.bmp'
  53. call check 'up_d.bmp'
  54. call check 'up_g.bmp'
  55. say 'All files found.'
  56. '@pause'
  57. call startups ' '
  58. say 'You will need about 2.1 megs available space to run Change Controls'
  59. say 'Hit [ENTER] to Install Change Controls. [Control-C to Abort]'
  60. say ''
  61. pull dummy .
  62. say ''
  63. instdir='C:\chg_ctls'
  64. exename='chg_pm.exe'
  65. call startups 'Installation directory'
  66. say 'The default installation directory for Change Controls is ' instdir
  67. say 'Did you want to install to another directory? [N]'
  68. parse upper pull dummy
  69. if dummy = 'Y' then do
  70. say 'Enter your new installation path :'
  71. parse upper pull instdir
  72. end
  73. call checkdir instdir
  74. say ''
  75. call startups 'Installing files...'
  76. say 'Copying files...'
  77. 'copy BUTTONS.BMP' instdir
  78. 'copy chg_ctls.cmd' instdir
  79. 'copy chg_pm.exe'  instdir
  80. 'copy chg_pm.HLP'  instdir
  81. 'copy chg_pm.INF'  instdir
  82. 'copy ctls.RC'     instdir
  83. 'copy ctls.RES'    instdir
  84. 'copy down.bmp'    instdir
  85. 'copy down_d.bmp'  instdir
  86. 'copy down_g.bmp'  instdir
  87. 'copy HIDE_D.BMP'  instdir
  88. 'copy HIDE_U.BMP'  instdir
  89. 'copy left.bmp'    instdir
  90. 'copy left_d.bmp'  instdir
  91. 'copy left_g.bmp'  instdir
  92. 'copy list.BMP'    instdir
  93. 'copy logos.zip'   instdir
  94. 'copy maxi_d.bmp'  instdir
  95. 'copy maxi_up.bmp' instdir
  96. 'copy max_d.BMP'   instdir
  97. 'copy max_u.bmp'   instdir
  98. 'copy min_d.bmp'   instdir
  99. 'copy min_up.BMP'  instdir
  100. 'copy motif.zip'   instdir
  101. 'copy npswpscb.bmp' instdir
  102. 'copy npswpscb.txt' instdir
  103. 'copy rdc.cmd'     instdir
  104. 'copy readme.cmd'  instdir
  105. 'copy REBUILD.CMD' instdir
  106. 'copy resmgr.cmd'  instdir
  107. 'copy RESMGR.ZIP'  instdir
  108. 'copy right.bmp'   instdir
  109. 'copy right_d.bmp' instdir
  110. 'copy right_g.bmp' instdir
  111. 'copy source.zip'  instdir
  112. 'copy swap_dll.exe' instdir
  113. 'copy swap_dll.txt' instdir
  114. 'copy sys_d_l.bmp' instdir
  115. 'copy sys_d_s.bmp' instdir
  116. 'copy sys_u_l.bmp' instdir
  117. 'copy sys_u_s.bmp' instdir
  118. 'copy up.bmp'      instdir
  119. 'copy up_d.bmp'    instdir
  120. 'copy up_g.bmp'    instdir
  121. say 'Done Copying.'
  122. '@pause'
  123. dlldir='C:\os2\dll'
  124. call startups 'Looking for pmmerge.dll'
  125. say 'Is your OS2 dll Directory [ c:\os2\dll ]? [Y]:'
  126. parse upper pull dummy
  127. if dummy = 'N' then do
  128. say 'Enter your OS2 dll Directory:'
  129. parse upper pull dlldir
  130. end
  131. call checkdir dlldir
  132. say ''
  133. say 'Copying pmmerge.dll ...'
  134. 'copy 'dlldir'\pmmerge.dll' instdir
  135. cfgsys='c:'
  136. call startups 'Adding Swap Dll Utility to config.sys'
  137. say 'Automatically add the Swap Dll utility to your config.sys?[N]:'
  138. parse upper pull dummy
  139. if dummy = 'Y' then do
  140. say 'What drive is OS2 installed on?'
  141. say '(Must have colon after drive letter example-> c: ): '
  142. parse upper pull cfgsys
  143. say 'making a backup of config.sys called config.chg...'
  144. 'copy ' cfgsys'\config.sys' cfgsys'\config.chg'
  145. say 'adding swap dll utility to your config.sys...'
  146. call lineout cfgsys'\config.sys','call='instdir'\swap_dll.exe /c'cfgsys'\os2\cmd.exe /s'instdir' /d'dlldir' /w5'
  147. '@pause'
  148. end
  149. call startups 'Creating WPS Objects'
  150. call SysDestroyObject('<chg_Folder>')
  151. say "Creating a folder for Change Controls..."
  152. title = "Change Controls"
  153. classname = 'WPFolder'
  154. location = '<WP_DESKTOP>'
  155. setup = 'OBJECTID=<chg_Folder>;OPEN=DEFAULT'
  156. call SysCreateObject classname,title,location,setup,f
  157. say 'Creating the program and readme objects...'
  158. title = "Change Controls 2.1"
  159. classname = 'WPProgram'
  160. location = '<chg_Folder>'
  161. setup = 'EXENAME='instdir'\'exename';PARAMETERS=%*;STARTUPDIR='instdir
  162. call SysCreateObject classname,title,location,setup,u
  163.  
  164. title = "Readme for Change Controls"
  165. classname = 'WPProgram'
  166. location = '<chg_Folder>'
  167. setup = 'EXENAME='instdir'\readme.cmd;PARAMETERS=%*;STARTUPDIR='instdir
  168. call SysCreateObject classname,title,location,setup,u
  169.  
  170. say 'Finished Installing Change Controls.'
  171. say 'Starting the Viewer on Help file'
  172. say 'Some last minute changes to the help file:'
  173. say ' '
  174. say 'You no longer need to manually copy pmmerge.dll into the install directory'
  175. say 'Also, the swap_dll.exe utility was automatically added to your config.sys'
  176. say 'if you allowed this install program to do it.'
  177. '@pause'
  178. 'view chg_pm'
  179. exit
  180.  
  181. check: procedure
  182.  
  183. rc = stream(ARG(1),'c','query exists')
  184. if rc = '' then
  185. do
  186.   call startups '!!!!!!!!!! ERROR !!!!!!!!!!'
  187.   say 'The file 'ARG(1)' was not found.'
  188.   say 'This program must be run from the directory where you unpacked the archive.'
  189.   '@pause'
  190.   exit
  191. end
  192. return
  193.  
  194. check2: procedure
  195.  
  196. rc = stream(instdir'\'ARG(1),'c','query exists')
  197. if rc = '' then
  198. do
  199.   call startups '!!!!!!!!!! ERROR !!!!!!!!!!'
  200.   say 'The file 'ARG(1)' was not correctly copied.'
  201.   say 'Not a huge problem, but you will have to manually copy'
  202.   say 'pmmerge.dll into the install directory before running Change Controls'
  203.   '@pause'
  204. end
  205. if rc <> '' then
  206. do
  207.   say '--Last minute correction to the Installation Instructions in the manual--'
  208.   say 'You no longer need to manually copy pmmerge.dll'
  209.   '@pause'
  210. end
  211. return
  212.  
  213.  
  214. checkdir: procedure
  215. parse upper arg DIR;
  216. curdir=directory()
  217. tstdir=directory(DIR);
  218. if tstdir\=DIR then
  219. do
  220. 'mkdir 'DIR
  221. end
  222. tstdir=directory(DIR);
  223. if tstdir\=DIR then
  224. do
  225.  
  226.  call startups '!!!!!!!!!! ERROR !!!!!!!!!!'
  227.  say 'You specified an invalid path.'
  228.  say tstdir ' -' DIR
  229.  say 'Run the installation program again after this problem is fixed.'
  230.  tstdir=directory(curdir)
  231. '@pause'
  232.  exit
  233.  
  234. end
  235. tstdir=directory(curdir)
  236. return
  237.  
  238.  
  239. startups: procedure
  240. call SysCls
  241. say'┌────────────────────────────────────────────────────────────────────────────┐'
  242. say'│  ▄█▀▄█ ▀██C▄C│'
  243. say'│ ▐█▌  █  ██ ▄▄    ▄▄▄   ▄ ▄▄▄    ▄▄▄▀    ▄▄▄C│'
  244. say'│ ██C██▀ ██  ▀▀▄██   ██ ██  ██ ██  ▄██ ██C│'
  245. say'│ ▐█▌C██  ██  ▄█ ██   ██ ██  ▀█▄█▀  ██▀▀▀▀C│'
  246. say'│  ▀█▄▄▀ ▄██  ██▄ ▀█▄▀▀▄ ▄██ ██▄  ▄▀██▄  ▀█▄▄▀C│'
  247. say'│C██  ██C│'
  248. say'│C▀██▄█▀C(C)1995 Matt Schellhaas │'
  249. say'│  ▄█▀▄█C▄C▀██C│'
  250. say'│ ▐█▌  █  ▄▄▄  ▄ ▄▄▄    ██   ▄ ▄▄▄   ▄▄▄   ██   ▄▄▄C│'
  251. say'│ ██C██ ██  ██ ██  ▀██▀   ██ ██ ██ ██  ██  ▀██▄C│'
  252. say'│ ▐█▌    ██ ██  ██ ██   ██    ██    ██ ██  ██    ▀██C│'
  253. say'│  ▀█▄▄▀ ▀█▄█▀ ▄██ ██▄  ▀█▄▀ ▄██    ▀█▄█▀ ▄██▄ ▀▄▄█▀C│'
  254. say'│C│'
  255. say'│CInstallationC│'
  256. say'└────────────────────────────────────────────────────────────────────────────┘'
  257. say''
  258. say'     'ARG(1)
  259. say ''
  260. return
  261.  
  262.